翻訳と辞書
Words near each other
・ "O" Is for Outlaw
・ "O"-Jung.Ban.Hap.
・ "Ode-to-Napoleon" hexachord
・ "Oh Yeah!" Live
・ "Our Contemporary" regional art exhibition (Leningrad, 1975)
・ "P" Is for Peril
・ "Pimpernel" Smith
・ "Polish death camp" controversy
・ "Pro knigi" ("About books")
・ "Prosopa" Greek Television Awards
・ "Pussy Cats" Starring the Walkmen
・ "Q" Is for Quarry
・ "R" Is for Ricochet
・ "R" The King (2016 film)
・ "Rags" Ragland
・ ! (album)
・ ! (disambiguation)
・ !!
・ !!!
・ !!! (album)
・ !!Destroy-Oh-Boy!!
・ !Action Pact!
・ !Arriba! La Pachanga
・ !Hero
・ !Hero (album)
・ !Kung language
・ !Oka Tokat
・ !PAUS3
・ !T.O.O.H.!
・ !Women Art Revolution


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Super (computer science) : ウィキペディア英語版
Inheritance (object-oriented programming)

Inheritance (OOP) is when an object or class is based on another object (prototypal inheritance) or class (class-based inheritance), using the same implementation (inheriting from an object or class) specifying implementation to maintain the same behavior (realizing an interface; inheriting behavior). It is a mechanism for code reuse and to allow independent extensions of the original software via public classes and interfaces. The relationships of objects or classes through inheritance give rise to a hierarchy. Inheritance was invented in 1967 for Simula.
Inheritance should not be confused with subtyping. In some languages inheritance and subtyping agree, while in others they differ; in general subtyping establishes an is-a relationship, while inheritance only reuses implementation and establishes a syntactic relationship, not necessarily a semantic relationship (inheritance does not ensure behavioral subtyping). To distinguish these concepts, subtyping is also known as ''interface inheritance,'' while inheritance as defined here is known as ''implementation inheritance'' or ''code inheritance''. Still, inheritance is a commonly used mechanism for establishing subtype relationships.
Inheritance is contrasted with object composition, where one object ''contains'' another object (or objects of one class contain objects of another class); see composition over inheritance. Composition implements a has-a relationship, in contrast to the is-a relationship of subtyping.
==Types of inheritance==

There are various types of inheritance, based on paradigm and specific language.
;Single inheritance: where subclasses inherit the features of one super class. A class acquires the properties of another class.
;Multiple inheritance: where one class can have more than one super class and inherit features from all parent classes.
;Multilevel inheritance: where a subclass is inherited from another subclass. It is not uncommon that a class is derived from another derived class as shown in the figure "Multilevel inheritance". The class ''A'' serves as a ''base class'' for the ''derived class'' ''B'', which in turn serves as a ''base class'' for the ''derived class'' ''C''. The class ''B'' is known as ''intermediate'' base class since it provides a link for the inheritance between ''A'' and ''C''. The chain ''ABC'' is known as ''inheritance path''.
A derived class with multilevel inheritance is declared as follows:

Class A(...); //Base class
Class B : public A(...); //B derived from A
Class C : public B(...); //C derived from B

This process can be extended to any number of levels.
;Hierarchical inheritance: where one class serves as a superclass (base class) for more than one sub class.
;Hybrid inheritance: a mix of two or more of the above types of inheritance.

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Inheritance (object-oriented programming)」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.